package controllers.weixin;

import auth.*;
import models.admin.AdminUser;
import models.bill.Bill;
import models.user.User;
import play.mvc.Controller;
import play.mvc.With;

import java.util.List;

/**
 * Application
 */
@With(WxMpAuth.class)
public class Application extends Controller {

    @UseJsApi({"scanQRCode"})
    public static void index() {
        User user = WxMpAuth.currentUser();
        List<Bill> bills = Bill.findByUser(user);
        if (bills != null && bills.size() > 5) {
            bills = bills.subList(0,5);
        }
        render(bills);
    }


}
